<!DOCTYPE html>
<html>
<head>
    <title>档案资料管理</title>
<#include "../common/common.ftl"/>
</head>
<body>
<div class="layui-fluid">
    <#--<form class="layui-form">-->
        <div class="layui-card">
            <div class="layui-card-header">【档案编号：${(contract.contractCode)!}，被动迁人：${(contract.name)!}】</div>
            <div class="layui-card-body">
                <div class="layui-row">
                    <div class="layui-col-xs2 layui-col-md2 layui-col-sm2 layui-inline " style="overflow: auto;height: 750px;">
                        <div class="site-tree">
                            <ul class="layui-tree">

                            <#if (fileType == '')>
                                <#list resultMap?keys as key>
                                    <li><h2>${(fileInfoMap[key])!}</h2></li>
                                    <#if resultMap[key]??>
                                        <#list resultMap[key] as fileCategory>
                                            <li><h2>${(fileInfoMap[result])!}</h2></li>

                                            <#assign typeMap="" />
                                            <#if key == '01'>
                                                <#assign typeMap = daMap />
                                            </#if>

                                            <li class="site-tree-noicon">
                                                <a href="javascript:void (0);" <#if fileCategory_index ==0 && fileCategory_index == 0> class="firstCaregory"</#if> fileCategory="${fileCategory}">
                                                    <cite>${typeMap[fileCategory]}【<span class="${fileCategory}_all">${(shMap[fileCategory][0])!"0"}</span>】</cite>
                                                </a>
                                            </li>
                                        </#list>
                                    </#if>

                                </#list>
                                   
                            <#else>
                                <li><h2>${(fileInfoMap[fileType])!}</h2></li>
                                <#assign typeMap="" />
                                <#if fileType == '01'>
                                    <#assign typeMap = daMap />
                                </#if>

                                <#list resultMap[fileType]?keys as fileCategory>
                                    <li class="site-tree-noicon">
                                        <a href="javascript:void (0);" <#if fileCategory_index == 0> class="firstCaregory"</#if> fileCategory="${fileCategory}">
                                            <cite>${typeMap[fileCategory]}【<span class="${fileCategory}_all">${(shMap[fileCategory][0])!"0"}</span>】</cite>
                                        </a>
                                    </li>
                                </#list>
                            </#if>

                            </ul>
                        </div>
                    </div>
                    <div class="layui-col-xs10 layui-col-md10 layui-col-sm10" id="right" style="overflow: auto;height: 750px;"></div>
                </div>
            </div>
        </div>
    <#--</form>-->
</div>
</body>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/layui/lib/modules/' //静态资源所在路径
    }).use('element', function () {
        var $ = layui.jquery;//jquery

        var fileCategory  = $(".firstCaregory").attr("fileCategory");
        showRight(fileCategory);

        $("ul li a").click(function () {
            var obj = $(this);
            $("ul li a").parent().removeClass("layui-this");
            obj.parent().addClass("layui-this");
            var fileCategory = obj.attr("fileCategory");
            showRight(fileCategory);
        });

        function showRight(fileCategory) {
            $("#right").html("加载中，请稍后！");
            $.get("shMap", {
                contractId: "${contract.id}",
                fileCategory: fileCategory,
                _time: new Date().getTime()
            }, function (data) {
                $("." + fileCategory + "_all").text(data.result);
            });
            $.get("right", {
                contractId: "${contract.id}",
                fileCategory: fileCategory,
                _time: new Date().getTime()
            }, function (data) {
                $("#right").html(data);
            });
            window.showRight = showRight;

            parent.loadData();
        }
    })
</script>
</html>
